# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=picard
pkgver=2.12.3
pkgrel=0
# armhf blocked by qt5-qtdeclarative
arch="all !armhf"
url="https://picard.musicbrainz.org/"
pkgdesc="Official MusicBrainz tagger"
license="GPL-2.0-or-later"
depends="
	chromaprint
	py3-dateutil
	py3-fasteners
	py3-mutagen
	py3-qt5
	py3-yaml
	"
makedepends="
	gettext
	py3-gpep517
	py3-setuptools
	py3-wheel
	python3-dev
	"
checkdepends="py3-pytest"
subpackages="$pkgname-lang $pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/metabrainz/picard/archive/release-$pkgver.tar.gz"
builddir="$srcdir/picard-release-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
b6e88c4c8f1f0ce6739a2a7f13950924b560569ab7e558732529a9f9dd1a4636d85177b12c07ba2d6b4e4cd1536844e274fd98c9dc487eaba7a5cba6abe37b44  picard-2.12.3.tar.gz
"
